import { fromJS } from 'immutable'
import * as mutation from '@/mutations/filmMution'

const initState = fromJS({
    films: []
})

const reducer = (state = initState, { type, data }) => {
    try {
        return mutation[type](state, data)
    } catch (error) {
        return state
    }
}

export default reducer
